﻿using WH.Model.Systems;
using Rw.Core.ORM.Domain.Organization;
using SqlSugar;

namespace WH.Model.Bases
{
    /// <summary>
    /// 继承实体
    /// </summary>
    public abstract class BaseOrgEntity : OrgEntity<string>, IOrgAggregateRoot<string>
    {
        /// <summary>
        /// 
        /// </summary>
        [SugarColumn(IsPrimaryKey = true, ColumnName = "id", IsNullable = false, Length = 50, ColumnDescription = "主键id")]
        public override string Id { get; set; } = null!;

        /// <summary>
        /// 机构id
        /// </summary>           
        [SugarColumn(ColumnName = "organization_id", IsNullable = false, Length = 50, ColumnDescription = "机构id")]
        public override string OrganizationId { get; set; } = null!;

        /// <summary>
        /// 机构
        /// </summary>
        [Navigate(NavigateType.OneToOne, nameof(OrganizationId))]
        public OrganizationEntity? Organization { get; set; }
    }
}